﻿namespace DAL.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class c : DbMigration
    {
        public override void Up()
        {
            Sql(@" create view View_Order_Detiles as  SELECT  dbo.DanPins.DanPinName, dbo.Orders.CreateTime, dbo.Orders.FaHuoZhuangTai, dbo.DanPins.Price, 
                   dbo.OrderDetls.ShopNum, dbo.Orders.OrderId, dbo.DanPins.Id, dbo.DanPins.ProductId, dbo.DanPins.ImgUrl, 
                   dbo.Orders.Address, dbo.Orders.CustomerId, dbo.Orders.ZhiFuZhuangTai, dbo.Orders.KeHuName, 
                   dbo.Orders.Phone
FROM      dbo.DanPins INNER JOIN
                   dbo.OrderDetls ON dbo.DanPins.Id = dbo.OrderDetls.Id INNER JOIN
                   dbo.Orders ON dbo.OrderDetls.OrderId = dbo.Orders.OrderId INNER JOIN
                   dbo.Customers ON dbo.DanPins.Id = dbo.Customers.Id");

        }

        public override void Down()
        {
            Sql(@"drop view View_Order_Detiles");
        }
    }
}
